Skip to content

fix: support RTX 50-series (Blackwell sm_120) CUDA via cu128 wheels (#217) - #218

Merged
thcp merged 2 commits into
mainfrom
fix/sm120-blackwell-cu128
Jun 23, 2026
Merged

fix: support RTX 50-series (Blackwell sm_120) CUDA via cu128 wheels (#217)#218
thcp merged 2 commits into
mainfrom
fix/sm120-blackwell-cu128

Conversation

@thcp

@thcp thcp commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Problem

NVIDIA RTX 50-series cards (Blackwell, compute capability sm_120) fail GPU stem extraction with:

RuntimeError: CUDA error: no kernel image is available for execution on the device

The stock torch 2.6 cu124/cu121 wheels were built before Blackwell and contain no sm_120 kernels. torch.cuda.is_available() still returns True, so detection "succeeds" and demucs is told to use cuda — then dies the moment a kernel runs. Blackwell support requires the cu128 wheels, which only exist for torch 2.7+.

Fixes #217.

Approach — targeted Blackwell carve-out

Only sm_120 / sm_100 GPUs get torch 2.7.1+cu128; every existing user stays on the validated 2.6.0 path, so there is no regression risk for the current base. The 2.7 wheel is fetched at runtime only — pyproject.toml and the build scripts are untouched.

The torch<2.7 pin exists because torchaudio 2.7+ changed its codec backend, but stems are written via torchaudio.save() which StemDeck already routes through soundfile/libsndfile, independent of the torch version — so the 2.7 wheel writes WAVs fine.

Changes (all in desktop/src-tauri/src/main.rs)

  • Compute-capability detectiondetect_nvidia_gpu() now also runs nvidia-smi --query-gpu=compute_cap (new detect_compute_cap() helper). Missing/N/A is non-fatal and falls back to the old logic.
  • wheel_tag() — routes compute-cap major >= 10cu128; everything else keeps the existing cu124/cu121/cu118 table.
  • Version-aware installinstall_cuda_torch() installs torch==2.7.1+cu128 for the cu128 tag, 2.6.0 for all others (unchanged).
  • Hardened verificationverify_cuda_torch() now forces a real kernel launch instead of trusting is_available(), so an incompatible wheel falls back to CPU cleanly instead of crashing mid-job. This is a safety net independent of the cu128 fix.
  • Unit testwheel_tag_routes_blackwell_to_cu128 covers Blackwell/Ada/Ampere/Turing/missing-cap.

Verification

  • cargo check compiles
  • cargo test wheel_tag passes
  • cargo fmt --check clean
  • Pending: validation on real RTX 5060 Ti hardware (@decrimtv-glitch offered to test) — confirm setup.log shows the cu128 install, cuda_verified = true, and a full GPU extraction with no error.

Note: 2.7.1+cu128 should be confirmed as the desired patch against the live PyTorch index before cutting the validation build.

Thales added 2 commits June 23, 2026 22:18
The stock torch 2.6 cu12x wheels have no sm_120 kernels, so Blackwell
GPUs (e.g. RTX 5060 Ti) pass torch.cuda.is_available() but crash mid-
extraction with "no kernel image is available for execution on the
device" (#217).

Targeted carve-out so existing users are untouched:
- detect_nvidia_gpu now also reads the GPU compute capability
- wheel_tag routes sm_100/sm_120 (cap major >= 10) to cu128, everything
  else keeps the existing cu124/cu121/cu118 heuristic
- install_cuda_torch installs torch 2.7.1+cu128 for the cu128 tag and
  stays on 2.6.0 for all other tags
- verify_cuda_torch now forces a real kernel launch instead of trusting
  is_available(), so an incompatible wheel falls back to CPU cleanly
  instead of crashing during a job

Closes #217
Trivy flags msgpack 1.1.2 with a HIGH advisory (out-of-bounds read /
crash on Unpacker reuse). It's a transitive dep via the torch/demucs
stack; bump to the fixed 1.2.1 to clear the trivy fs scan.
@thcp
thcp merged commit 7be60c4 into main Jun 23, 2026
8 checks passed
@thcp
thcp deleted the fix/sm120-blackwell-cu128 branch June 28, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: RTX 5060 Ti (sm_120) compatibility: RuntimeError: no kernel image available

1 participant